/*******************************************************************************
* Project: QSAR(Cute Software Architecture) 
*
* Copyright: Copyright(C) 2024 by YuetingBen, All Rights Reserved
*
* File name: NvmCfg.h
*
* Brief: ;
*
* Author: Yueting.Ben
*
* Module: Nvm
*
*******************************************************************************/

#ifndef NVMCFG_H
#define NVMCFG_H

/** HEADER FILES **/
#include "NvmType.h"
#include "NvmRte.h" 


/** MACRO DEFINITION **/


/** TYPEDEF DEFINITION **/
typedef uint8 NvMBlockCrcTypeType;
#define NVM_CRC8 ((NvMBlockCrcTypeType)0u)
#define NVM_CRC16 ((NvMBlockCrcTypeType)1u)
#define NVM_CRC32 ((NvMBlockCrcTypeType)2u) 

typedef uint8 NvMBlockJobPriorityType; /* Defines the job priority for a NVRAM block */

typedef uint8 NvMBlockManagementTypeType;
#define VM_BLOCK_NATIVE ((NvMBlockManagementTypeType)0u)
#define NVM_BLOCK_REDUNDANT ((NvMBlockManagementTypeType)1u)
#define NVM_BLOCK_DATASET  ((NvMBlockManagementTypeType)2u) 

typedef uint16 NvMNvBlockBaseNumberType;

typedef uint16 NvMNvBlockLengthType;

typedef uint8 NvMNvBlockNumType;

typedef uint8 NvMNvramDeviceIdType;

typedef uint8* NvMRamBlockDataAddressType;

typedef uint8* NvMRomBlockDataAddressType;

typedef uint8 NvMRomBlockNumType;

typedef struct
{
    NvMBlockCrcTypeType NvMBlockCrcType;
    NvMBlockJobPriorityType NvMBlockJobPriority; /* NvMBlockJobPriority */
    NvMBlockManagementTypeType NvMBlockManagementType;
    boolean NvMBlockUseCrc;
    NvMNvBlockBaseNumberType NvMNvBlockBaseNumber;
    NvMNvBlockLengthType NvMNvBlockLength;
    NvMNvBlockNumType NvMNvBlockNum;
    NvMNvramDeviceIdType NvMNvramDeviceId;
    NvMRamBlockDataAddressType NvMRamBlockDataAddress;
    NvMRomBlockDataAddressType NvMRomBlockDataAddress;
    NvMRomBlockNumType NvMRomBlockNum;
    /* DefineswhetheraNVRAMblockshallbeprocessedduring NvM_ReadAllornot. */
    boolean NvMSelectBlockForReadAll;
    /*  DefineswhetheraNVRAMblockshallbeprocessedduring NvM_WriteAllornot */
    boolean NvMSelectBlockForWriteAll;
}NvMBlockDescriptorType;


/** LOCAL DATA DEFINITION **/
extern const NvMBlockDescriptorType NvMBlockDescriptorTable[NvmConf_Block_Max];
extern const NvM_ConfigType NvMConfig;

#endif
